// 提供首页相关接口函数
import request from '@/utils/request'

/**
 * 账号密码登陆
 * @param {String} userName -账号
 * @param {String} password -密码
 * @returns Promise
 */
export const userAccountLogin = ({ userName, password, info }) => {
  return request('/user/login', 'post', { userName, password, info })
}

// 注册用户
export const addUser = ({ userName, password, info }) => {
  return request('/user/register', 'post', { userName, password, info })
}
// 收集用户点击的数据
export const collectUserInfo = ({ userName, info }) => {
  return request('/user/collect', 'post', { userName, info })
}

// 退出登录
export const userLogout = () => {
  return request('/user/logout', 'get')
}

/**
 * 用户信息
 * @returns Promise
 */
export const findUserInfo = ({ userName }) => {
  return request('/user', 'post', { userName })
}
